package p.ithorns.sample.influxdb;

import com.influxdb.annotations.Column;
import com.influxdb.annotations.Measurement;
import lombok.Getter;
import lombok.Setter;

import java.time.Instant;

/**
 * Home
 *
 * @author HtL
 * @date 2025/1/15 15:47
 * @since 1.0.0
 */
@Getter
@Setter
@Measurement(name = "home")
public class Home {

    @Column(tag = true)
    private String room;

    @Column
    private int co;

    @Column
    private double hum;

    @Column
    private double temp;

    @Column(timestamp = true)
    Instant time;

    @Override
    public String toString() {
        return "{" +
                "room:'" + room + '\'' +
                ", co:" + co +
                ", hum:" + hum +
                ", temp:" + temp +
                ", time:" + time +
                "}";
    }
}